#ifndef UTILITIES_H
#define UTILITIES_H

#include <random>
#include <vector>
#include <utility>

#include "raylib.h"
#include "raymath.h"

struct Polar3D {
	float length;
	float alpha;
	float beta;
};

Vector3 Polar3DToXYZRandom(Polar3D polar);

Vector3 Polar3DToXYZ(Polar3D polar);

std::pair<Vector3, Vector3> getOtherNormal(Vector3 normal);

// 获取给定圆心、半径、点数的同z平面圆
std::vector<Vector3> genCirclePos(Vector3 center, float radius, uint8_t posCount);

// 获取给定任意法向量以及圆心、半径的圆离散点
std::vector<Vector3> getNormalCirclePos(Vector3 circlePos, float radius, Vector3 normal, float startAngle, float endAngle, uint8_t pointCount);

std::vector<Vector3> getNormalConePos(Vector3 circlePos, Vector3 normal, float radius);

Vector3 getRandomNormal(float startAlpha, float endAlpha, float startBeta, float endBeta);

Color getRandomColor();

std::vector<Vector3> getBallPos(Vector3 ballPos, float radius, uint8_t alphaCount, uint8_t betaCount);

std::vector<Vector3> getHeartPos(Vector3 heartPos, Vector3 normal, float radius, uint8_t pointCount);

std::vector<Vector3> getRosebushPos(Vector3 rosebushPos, Vector3 normal, float radius, uint8_t bushCount);

std::vector<Vector3> getSpeedlistFromPoslist(Vector3 corePos, float speedNorm, const std::vector<Vector3>& posList);

std::vector<Vector3> getSpeedListFormPoslistWithRatio(Vector3 corePos, float ratio, const std::vector<Vector3>& posList);

bool isToDo(float iterRatio);

#endif
